import Taro, { Component } from '@tarojs/taro'
import {View, Text, Image, Button} from '@tarojs/components'
import './index.scss'

export default class Empty extends Component {

  static defaultProps = {
    image: '',
    text: '',
    btn: '',
    onClick: () => {}
  }

  render () {
    const { image, text, btn, onClick } = this.props
    return (
      <View className='empty'>
        {
          image &&
          <Image className='empty-img' src={image} />
        }

        <Text className='empty-txt'>
          {text || '去添加点什么吧'}
        </Text>
        {
          btn &&
          <Button onClick={onClick} className='empty-btn'>
            <Text className='empty-btn-txt' >{btn}</Text>
          </Button>
        }
      </View>
    )
  }
}
